package com.jxc.jxc01.grc.web;

import com.jxc.jxc01.grc.service.IVendorService;
import com.jxc.jxc01.grc.service.impl.VendorServiceImpl;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(value = "/deleteVendor")
public class DeleteVendorServlet extends HttpServlet {
    IVendorService vendorService = new VendorServiceImpl();
    @Override
    protected void service(HttpServletRequest request,
                           HttpServletResponse response)
            throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");

        int id = Integer.parseInt(request.getParameter("id"));
        vendorService.deleteVendor(id);
    }
}
